//
//  CTCResponderHistoryCell.m
//  ConsultantVersion
//
//  Created by 李小龙 on 2017/3/27.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "CTCResponderHistoryCell.h"
@interface CTCResponderHistoryCell ()
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIView *redView;

@end
@implementation CTCResponderHistoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setQuestionModel:(CTCQuestionModel *)questionModel
{
    _questionModel = questionModel;
    
    [SDWebImageTool imageView:self.headImageView imageName:questionModel.headImg placeHolder:@"default-head" showProgress:NO];
    self.contentLabel.text = questionModel.content;
    self.dateLabel.text = [NSDate stringFromTimestamp:questionModel.date];
    self.nameLabel.text = questionModel.name;
//    1被采纳  2 3未被采纳
//    1 3 不显示小红点  2 显示
    
    if ([questionModel.status integerValue] == 1) {
        self.statusLabel.backgroundColor = HEXCOLOR(0x2daee5);
        self.statusLabel.text = @"被采纳";
    } else if ([questionModel.status integerValue] == 4){
        self.statusLabel.backgroundColor = HEXCOLOR(0xff0000);
        self.statusLabel.text = @"已过期";
    }
    else {
        self.statusLabel.backgroundColor = HEXCOLOR(0xf79e06);
        self.statusLabel.text = @"未被采纳";
    }
    
    if ([questionModel.status integerValue] == 2) {
        self.redView.hidden = NO;
    } else {
        self.redView.hidden = YES;
    } 
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
